# Makefile for the complete TPIE system.
# $Id: Makefile.in,v 1.21 2002/06/10 20:44:30 tavi Exp $

# To compile with debugging symbols, set this to 1.
MINUSG = 0
# To compile with gprof symbols, set this to 1.
MINUSPG = 0

MY_DEFS := @DEFS@
MY_LIBS := @LIBS@

# Send all variables into recursive makes.
export

# The directories storing the components of the system

LIBPATH := ./lib/
LIBSRCPATH := $(LIBPATH)src/
TESTPATH := ./test/
INCPATH := ./include/

# Public targets.

usage:
	@echo $(MAKE) "[ all | include | lib | test | clean | distclean ]"

all: include lib test 

include:
	$(MAKE) -C $(INCPATH) all

lib: include
	$(MAKE) -C $(LIBSRCPATH) all
	$(MAKE) -C $(LIBPATH) all

test: 
	$(MAKE) -C $(TESTPATH) all

depend: include
	$(MAKE) -C $(LIBSRCPATH) $@
	$(MAKE) -C $(TESTPATH) $@

clean:
	rm -f $(TESTPATH)/Makefile.depend; touch $(TESTPATH)/Makefile.depend
	$(MAKE) -C $(TESTPATH) $@
	$(MAKE) -C $(LIBPATH) $@
	$(MAKE) -C $(INCPATH) $@

dirs := ./ $(TESTPATH) $(LIBPATH) $(LIBSRCPATH) $(INCPATH)
distclean: clean
	rm -f config.log config.cache config.status
	$(foreach dir,$(dirs),(rm -f $(dir)/*~; rm -f $(dir)/Makefile);)

# Private targets.

.PHONY : clean lib include test usage all distclean

